package com.oracle.containers.map;


import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author zhouyanxiang
 * @create 2020-08-2020/8/17-10:35
 */
public class ConcurrentHashMapReview {
    public static void main(String[] args) {
        ConcurrentHashMap<Integer,Integer> curMap = new ConcurrentHashMap<>();

        for (int i = 0; i < 10; i++) {
            curMap.put(i,i * 10);
        }

        for(Map.Entry<Integer, Integer> map : curMap.entrySet()){
            System.out.println("Key : " +   map.getKey() + " value: " + map.getValue());
        }

        ConcurrentHashMap<String, String> hashtable = new ConcurrentHashMap<>();
        for (int i = 0; i < 10; i++) {
            hashtable.put("key " + i," value " + 10*i);
        }

        for (Map.Entry<String, String> map : hashtable.entrySet()){
            System.out.println(map.getKey() + map.getValue());
        }
    }
}
